#include<stdio.h>
int main()
{
    int a[7]={3,4,5,6,7,1,2};
    int m;
    scanf("%d",&m);
    printf("%d",a[m-1]);
    return 0;
}